namespace sight {
    export class GameScene extends hjc.Scene {
        constructor() {
            super()
        }

        protected displayed() {
            var self = this;
            var url: string = "resource/sight/map/map_1.tmx";
            var urlLoader: egret.URLLoader = new egret.URLLoader();
            urlLoader.dataFormat = egret.URLLoaderDataFormat.TEXT;
            //load complete
            urlLoader.addEventListener(egret.Event.COMPLETE, function (event: egret.Event): void {
                console.debug("Tiled加载完成")
                var data: any = egret.XML.parse(event.target.data);
                var tmxTileMap: tiled.TMXTilemap = new tiled.TMXTilemap(500, 500, data, url)
                tmxTileMap.render()
                self.addChild(tmxTileMap)

                self.addEventListener(egret.Event.ENTER_FRAME, () => {
                    tmxTileMap.x -= 1
                }, self)
            }, url)
            urlLoader.load(new egret.URLRequest(url))
        }
    }
}